/**
 * 角色表
 */
import { BaseEntity } from 'egg-cool-entity';
import { Entity, Column, OneToMany } from 'typeorm';
import Product from './product';

@Entity({ name: 'plan' })
export default class Paln extends BaseEntity {

    @Column({
        comment: '计划标题',
        nullable: true,
    })
    title: string;
    /**
     * 映射产品
     */
    @OneToMany(_type => Product, product => product.plan, {
        cascade: true,
    })
    products: Product[];

    @Column({
        comment: '订单部门',
        nullable: true,
    })
    dept: string;

    @Column({
        comment: '制表人员',
        nullable: true,
    })
    producer: string;

    @Column({
        comment: '生产线',
        nullable: true,
    })
    assembly: string;

    @Column({
        comment: '要货日期',
        nullable: true,
    })
    take: Date;
}
